import os
import cv2
path = r'C:\Users\Admin\Desktop\imagedata\save_retif'

for n in range(176):
    img_name = '333_' + str(n+1) + '.tif'
    img = cv2.imread(os.path.join(r'C:\Users\Admin\Desktop\imagedata\retif', img_name))
    x = n // 16
    y = n % 16
    name = str(x) + "_" + str(y) + '.tif'
    cv2.imwrite(os.path.join(path, name), img)